<html><head><title>GridDD.js</title><link rel="stylesheet" type="text/css" href="../resources/style.css" media="screen"/></head><body><h1>GridDD.js</h1><pre class="highlighted"><code><i>// private</i>
<i>// This is a support class used internally by the Grid components</i>
Ext.grid.GridDragZone = <b>function</b>(grid, config){
    <b>this</b>.view = grid.getView();
    Ext.grid.GridDragZone.superclass.constructor.call(<b>this</b>, <b>this</b>.view.mainBody.dom, config);
    <b>if</b>(this.view.lockedBody){
        <b>this</b>.setHandleElId(Ext.id(<b>this</b>.view.mainBody.dom));
        <b>this</b>.setOuterHandleElId(Ext.id(<b>this</b>.view.lockedBody.dom));
    }
    <b>this</b>.scroll = false;
    <b>this</b>.grid = grid;
    <b>this</b>.ddel = document.createElement(<em>'div'</em>);
    <b>this</b>.ddel.className = <em>'x-grid-dd-wrap'</em>;
};

Ext.extend(Ext.grid.GridDragZone, Ext.dd.DragZone, {
    ddGroup : &quot;GridDD&quot;,

    getDragData : <b>function</b>(e){
        <b>var</b> t = Ext.lib.Event.getTarget(e);
        <b>var</b> rowIndex = <b>this</b>.view.findRowIndex(t);
        <b>if</b>(rowIndex !== false){
            <b>var</b> sm = <b>this</b>.grid.selModel;
            <b>if</b>(!sm.isSelected(rowIndex) || e.hasModifier()){
                sm.handleMouseDown(e, t);
            }
            <b>return</b> {grid: <b>this</b>.grid, ddel: <b>this</b>.ddel, rowIndex: rowIndex, selections:sm.getSelections()};
        }
        <b>return</b> false;
    },

    onInitDrag : <b>function</b>(e){
        <b>var</b> data = <b>this</b>.dragData;
        <b>this</b>.ddel.innerHTML = <b>this</b>.grid.getDragDropText();
        <b>this</b>.proxy.update(<b>this</b>.ddel);
        <i>// fire start drag?</i>
    },

    afterRepair : <b>function</b>(){
        <b>this</b>.dragging = false;
    },

    getRepairXY : <b>function</b>(e, data){
        <b>return</b> false;
    },

    onEndDrag : <b>function</b>(data, e){
        <i>// fire end drag?</i>
    },

    onValidDrop : <b>function</b>(dd, e, id){
        <i>// fire drag drop?</i>
        <b>this</b>.hideProxy();
    },

    beforeInvalidDrop : <b>function</b>(e, id){

    }
});</code></pre><hr><div style="font-size:10px;text-align:center;color:gray;">Ext - Copyright &copy; 2006-2007 Ext JS, LLC<br />All rights reserved.</div>
    </body></html>